﻿using System;
using System.Collections.Generic;
using System.Text;
using HAVNet.Core.String;


namespace HAVNet.Intros.AST
{
    public class ASTAccessorEvents : List<ASTAccessorEvent>
    {
        public override string  ToString ()
        {
            return Strings.joinobjs(Environment.NewLine, this);
        }
    }

    public class ASTAccessorEvent : ASTNode
    {
        protected ASTAttributeGroups _attrGroups = null;
        
        public ASTAttributeGroups   attrGroups  { get { if (null == _attrGroups) _attrGroups = new ASTAttributeGroups(); return _attrGroups; } }
        public ASTBlock             block       { get; set; }
    }

    public class ASTAccessorEventAdd : ASTAccessorEvent
    {
        public override string ToString()
        {
            string sAttrGroups = (null == _attrGroups ? "" : _attrGroups.ToString() + Environment.NewLine);
            return sAttrGroups + "add" + Environment.NewLine + block.ToString();
        }
    }

    public class ASTAccessorEventRemove : ASTAccessorEvent
    {
        public override string ToString()
        {
            string sAttrGroups = (null == _attrGroups ? "" : _attrGroups.ToString() + Environment.NewLine);
            return sAttrGroups + "remove" + Environment.NewLine + block.ToString();
        }
    }
}
